import { create } from 'zustand'

interface ThemeState {
  mode: 'dark' | 'light'
}

interface ThemeAction {
  toggle: () => void
}

export const useThemeStore = create<ThemeState & ThemeAction>()(set => ({
  mode: 'light',
  toggle: () =>
    set(state => ({ mode: state.mode === 'dark' ? 'light' : 'dark' })),
}))
